//
//  MonitorViewController.h
//  IBaby
//
//  Created by ZengYuan on 14/11/21.
//  Copyright (c) 2014年 com.zhongwei. All rights reserved.
//

#import "ParentController.h"
//#import "OnlineEngine.h"
#import "WaitView.h"
#import "DeviceUnit.h"
//#import "ClassAreaUnit.h"
#import "BannerView.h"
#import "FullLoadingView.h"
//#import "LoginedController.h"
#import "OpenGLView20.h"
//#import "AWPlayerController.h"
//#import "WeekUnit.h"
//#import "JKUnit.h"
//#import "BabyInfo.h"
//#import "ProgressView.h"

//#import "RateView.h"
#import "DeviceUnit.h"
#import "ChannelUnit.h"
#import "YellowTitleBtn.h"


#define KOTHERPLACE_TITLE @"下线通知"
#define KOTHERPLACE_CONTENT @"您的账号在别的设备上登录，如非本人操作则密码可能已经泄漏，建议立即修改密码或者联系管理员冻结账号"

@interface MonitorViewController : ParentController<UITableViewDataSource, UITableViewDelegate, UIGestureRecognizerDelegate>
{
//    ZhongweiLib *lib;
    
    int kickOffCount; //踢下线次数
    
    NSArray         *babyList;//宝宝信息
    
    NSMutableArray  *classAreaArray;
    
//    OnlineEngine    *onlineEngine;
    
    IBOutlet UIView *carrierView; //直播view
    
    long               mDuration;
    
    WaitView           *waitview;
    ErrorView          *errorview;
    BannerView         *bannerview;

    UIView             *landscapeBottomView;
    UIButton           *landscape_scaleBtn;
    UIButton           *landscape_captureBtn;
    UIView             *landscapeTopView;

    
//    BOOL                allowUserPlayVideoIn3G;
    
//    UITableView *tableView;
//    UIButton *carrierBtn;
     int openedSectionIndex;
//    int selectedClassAreaIndex;
//    int selectedDeviceIndex;

    NSMutableDictionary *openedSectionDic; //控制section打开、关闭的数据源

//    ClassAreaUnit *currentSelectedClassArea;
    ChannelUnit *currentSelectedDevice;
    
    MBProgressHUD *hud;
    
//    NSTimer *timer;
    
    float carrierWidth;
    UIButton *pauseBtn;//暂停按钮
    
    UIButton *resumePlayingTapBtn;
    BOOL ensureAskAlertShowing; //当前是否有无wifi警示框
    
    UIView  *portraitView; //底部view
    UILabel *deviceNameLabel;
    
    UIButton *scaleBtn; //底部全屏按钮
    YellowTitleBtn *captureBtn;//底部截图按钮
    
    UIView     *devicesListCoverView;
    UITableView*devicesTableView;
    
    
    UIView *leftLoadingFakeView;
    UIView *rightLoadingFakeView;
    CGFloat leftLoadingFakeOriginalX;
    CGFloat rightLoadingFakeOriginalX;

//    ProgressView *progressView;//不加
    
    /*当前播放的是成功视频帧，此目的是为了保证返回
      前一界面的时候,是否截图
    */
    BOOL        currentSuccessVideoFrame;
        
    OpenGLView20       *openglview;
    
 
    CGFloat StandardPortraitScreenWidth;     //iphone6 375
    CGFloat StandardPortraitScreenHeight;    //iphone6 667

//    RateView *rateView;
    
    UIView *plotCoverView;
}
@property BOOL needLogin;
-(void)releasePlayer;

@property NSArray   *devicesArray;
@property NSInteger currentDeviceIndex;
@property NSTimeInterval servertinterval;  //服务器与客户端的时间差距
//@property WeekUnit *currentWeekUnit;       //当前周的安排规则
//@property BOOL disabledPlayingStreamJustViewSee;

@property NSDate *beginDate;
@property NSDate *endDate;

-(void)startPreparePlaying;
-(void)resetOrientationPortrait;

@end
